package leetcode.editor.cn;

import java.util.ArrayList;
import java.util.List;

public class P401BinaryWatch {
    public static void main(String[] args) {
        Solution solution = new P401BinaryWatch().new Solution();

    }

    static int[] arr1 = {8, 4, 2, 1};
    static int[] arr2 = {32, 16, 8, 4, 2, 1};

    //leetcode submit region begin(Prohibit modification and deletion)
    class Solution {
        public List<String> readBinaryWatch(int turnedOn) {
            List<String> ans = new ArrayList<String>();
            for (int h = 0; h < 12; ++h) {
                for (int m = 0; m < 60; ++m) {
                    if (Integer.bitCount(h) + Integer.bitCount(m) == turnedOn) {
                        ans.add(h + ":" + (m < 10 ? "0" : "") + m);
                    }
                }
            }
            return ans;
        }
    }
//leetcode submit region end(Prohibit modification and deletion)

}